package com.flower.subject.application.controller;




import com.flower.subject.api.entity.AuthUserDTO;
import com.flower.subject.api.entity.Result;
import com.flower.subject.api.req.UserFeignService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author lavender
 * @version 1.0
 * @date 2024-07-26 15:22
 */
@RequestMapping("feign")
@RestController
public class FeignController {

    @Resource
    private UserFeignService userFeignService;


    @GetMapping("/getUserInfo")
    public Result<AuthUserDTO> getUserInfo(@RequestParam("username") String userName) {
        System.out.println("userName:" + userName);
        AuthUserDTO authUserDTO = new AuthUserDTO();
        authUserDTO.setUserName(userName);
        Result<AuthUserDTO> userInfo = userFeignService.getUserInfo(authUserDTO);
        return userInfo;
    }
}
